<%--
  Created by IntelliJ IDEA.
  User: jia19
  Date: 2015/9/27
  Time: 23:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/index.do">网络购书系统</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li <c:if test="${current=='home'}"> class="active" </c:if>> <a href="/index.do">首页</a></li>
                <li <c:if test="${current=='excellent'}"> class="active" </c:if>> <a href="/excellentBook.do">精品图书</a></li>
                <li <c:if test="${current=='new'}"> class="active" </c:if>> <a href="/newBook.do">新书上架</a></li>
            </ul>
            <form class="navbar-form navbar-left" role="search" method="post" action="/search.do">
                <div class="form-group">
                    <input name="keyword" type="text" class="form-control" placeholder="请输入要搜索的书名">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li <c:if test="${current=='cart'}"> class="active" </c:if>><a href="/shoppingCart.do"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>&nbsp; 购物车</a></li>
                <li class="dropdown">
                    <c:if test="${isLogin eq false}">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                           aria-haspopup="true" aria-expanded="false">
                            请登录
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="/login.do">登录</a></li>
                            <li><a href="/reg.do">注册</a></li>
                        </ul>
                    </c:if>
                    <c:if test="${isLogin eq true}">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                           aria-haspopup="true" aria-expanded="false">
                            您好，${loginName}
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="/userInfo.do">个人资料</a></li>
                            <li><a href="/MyOrder.do">我的订单</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/logout.do">退出</a></li>
                        </ul>
                    </c:if>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>